'''
Contains django-generated HTML forms used to gather data from the user. The form information can be eaisily validated based on the constraints definrd in the model module. 
'''

from django.forms.models import ModelForm
from maps.models import Event
from maps.models import Comment

#class EventForm(forms.Form):
#    name = forms.CharField()
#    description = forms.CharField()
#    sample_checkbox = forms.BooleanField(required=False)

class EventForm2(ModelForm):
    ''' A form used to gather data about the event.'''    
    
    class Meta:
        ''' Defines the model class the form is based on. Customizes the form.'''
        model = Event
        #exclude - which attributes should be excluded from the form. If an attribute is required by the model class it has to be providedd otherwise before the object can be saved in the database.
        exclude = ('comments', 'subscriptions', 'ratings', 'tags')
        
class CommentForm(ModelForm):
    ''' A form used to create a comments associated with the event. To be displayed in the event details view.'''    
    
    class Meta:
        model = Comment
        exclude = ('user', 'event')

